package com.keyancompany.zhongbaopingtai.api;

import com.keyancompany.zhongbaopingtai.ConstansUrl;
import com.keyancompany.zhongbaopingtai.listener.IAsyncHttpResponseHandler;
import com.keyancompany.zhongbaopingtai.listener.LoadingHanlder;
import com.loopj.android.http.RequestParams;

/**
 * Created by lyh on 2016/10/11.
 */
public class CollectionAPI extends BaseAPI {


    public static final int COLLECTION_LIST = 0X411;
    public static final int ADD_COLLECTION = 0X412;
    public static final int DELETE_COLLECTION = 0X413;

    public static final void getCollectionList(int current, IAsyncHttpResponseHandler handler, LoadingHanlder loading) {
        RequestParams params = new RequestParams();
        params.put("userId", UserAPI.getUserId());
        params.put("current", current + "");
        params.put("pageSize", DETAULT_COUNT + "");
        post(ConstansUrl.COLLECTION_LIST, params, handler, COLLECTION_LIST, loading);
    }

    public static final void deleteCollection(String projectpid, IAsyncHttpResponseHandler handler, LoadingHanlder loading) {
        RequestParams params = new RequestParams();
        params.put("userId", UserAPI.getUserId());
        params.put("pid", projectpid);
        post(ConstansUrl.DELETE_COLLECTION, params, handler, DELETE_COLLECTION, loading);
    }

    public static final void addCollection(String projectpid, IAsyncHttpResponseHandler handler, LoadingHanlder loading) {
        RequestParams params = new RequestParams();
        params.put("userId", UserAPI.getUserId());
        params.put("pid", projectpid);
        post(ConstansUrl.ADD_COLLECTION, params, handler, ADD_COLLECTION, loading);
    }

}


